package com.hospital.xiaochengxiu.yang.controller;

import com.alibaba.fastjson.JSON;
import com.hospital.xiaochengxiu.yang.entity.DoctorFalls;
import com.hospital.xiaochengxiu.yang.service.DoctorArrangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 医生值班控制类
 */
@RestController
@RequestMapping("/api")
public class DoctorArrangeController {
    @Autowired
    private DoctorArrangeService service;

    /**
     * 查询莫一天对应科室的值班人员
     * @param dept 科室
     * @param date  日期
     * @return  返回上班人员的信息
     */
    @GetMapping("/arrage/{dept}/{date}")
    public String selDepartmentCt(@PathVariable String dept, @PathVariable String date){
        List<DoctorFalls> list = service.arrange(dept, date);
        return JSON.toJSONString(list);
    }


}
